package cn.eeepay.boss.action.workOrder;

import java.util.Arrays;
import java.util.Map;

import cn.eeepay.framework.model.workOrder.WorkWarningRecordEntity;
import cn.eeepay.framework.service.workOrder.WorkWarningRecordService;
import cn.eeepay.framework.util.ResultModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 工单预警记录表
 *
 * @author quanhz
 * @email 
 * @date 2020-08-20 09:01:59
 */
@RestController
@RequestMapping("generator/workwarningrecord")
public class WorkWarningRecordController {
    @Autowired
    private WorkWarningRecordService workWarningRecordService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public ResultModel list(@RequestParam Map<String, Object> params){

        return ResultModel.ok();
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public ResultModel info(@PathVariable("id") Long id){
		WorkWarningRecordEntity workWarningRecord = workWarningRecordService.getById(id);

        return ResultModel.ok().put("workWarningRecord", workWarningRecord);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public ResultModel save(@RequestBody WorkWarningRecordEntity workWarningRecord){
		workWarningRecordService.save(workWarningRecord);

        return ResultModel.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public ResultModel update(@RequestBody WorkWarningRecordEntity workWarningRecord){
		workWarningRecordService.updateById(workWarningRecord);

        return ResultModel.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public ResultModel delete(@RequestBody Long[] ids){
		workWarningRecordService.removeByIds(Arrays.asList(ids));

        return ResultModel.ok();
    }

}
